<div id="modals">
	<div class="show_title">
		<h2>模版列表</h2>
	</div>
    <div id="search_area" class="right">
        <input class="input" name="search_txt" id="search_txt" style="width:200px"/><input class="input" type="button" name="search_btn" value="搜索" />
    </div>
    <div class="clear">
    </div>
    <div class="top_action">
        <select class="select" name="action">
            <option value="0">批量动作</option>
            <option value="/admin/admin_modal/delmodals">删除</option>
        </select>
        <input class="input" type="button" name="do_btn" id="do_btn" value="应用">
        </input><!--<select class="select" id="filter">
        <option value="0">查看全部分类目录</option>
        <option value="/admin/admin_manage/getmodals?style=type&type=ka">卡市</option>
        </select>
        <input type="button" class="input" name="filter_btn" id="filter_btn" value="过滤">
        </input>-->
        <div class="page right">
            <if $page_info.page.previous_url>
                <a class='text' href='[@htmlspecialchars($page_info.page.previous_url)]'>上一页</a>
            </if>
            <foreach name="page_info.page.pages" key="key" var="var">
                <if $var.page_num == $page_info.current_page>
                    <span title="第[@htmlspecialchars($var.page_num)]页">[@htmlspecialchars($var.page_num)]</span>
                    <else>
                    <a class="num" href="[@htmlspecialchars($var.page_link)]" title="第[@htmlspecialchars($var.page_num)]页">[@htmlspecialchars($var.page_num)]</a>
                </if>
            </foreach>
            <if $page_info.page.next_url>
                <a class='text' href='[@htmlspecialchars($page_info.page.next_url)]'>下一页</a>
            </if>
        </div>
    </div>
	<if $result.modals>
    <table width="100%" class="fixed table">
        <thead>
            <tr>
                <th width="10%">
                    <input type="checkbox" name="check_all"/>
                </th>
                <th width="30%">
                   模本标题
                </th>
                <th width="30%">
                  文件名称
                </th>
                <th width="30%">
                    是否多图模式
                </th>
            </tr>
        </thead>
        <tfoot>
             <tr>
                <th width="10%">
                    <input type="checkbox" name="check_all"/>
                </th>
                <th width="30%">
                   模本标题
                </th>
                <th width="30%">
                  文件名称
                </th>
                <th width="30%">
                    是否多图模式
                </th>
            </tr>
        </tfoot>
        <tbody>
            <foreach name="result.modals" var="modal" key="key">
                <tr class="table_list">
                    <th>
                        <input type="checkbox" id="[$modal.mt_id]" value="[$modal.mt_id]"/>
                    </th>
                    <td>
                        [@htmlspecialchars($modal.mt_name)]
                        <div class="row_action" num="[$modal.mt_id]">
                            <span class="action_edit"><a href="/admin/admin_modal/editmodal">编辑</a></span>|<span class="action_delete"><a href="javascript:;">删除</a></span>
                        </div>
                    </td>
                    <td>
                        [@htmlspecialchars($modal.mt_formwork_name)]
                    </td>
                    <td>
                        [@htmlspecialchars($modal.mt_is_multi)]
                    </td>
                </tr>
            </foreach>
        </tbody>
    </table>
	<else>
		<div class="nothing">没有记录</div>
	</if>
    <div class="top_action">
        <div class="page right">
            <if $page_info.page.previous_url>
                <a class='text' href='[@htmlspecialchars($page_info.page.previous_url)]'>上一页</a>
            </if>
            <foreach name="page_info.page.pages" key="key" var="var">
                <if $var.page_num == $page_info.current_page>
                    <span title="第[@htmlspecialchars($var.page_num)]页">[@htmlspecialchars($var.page_num)]</span>
                    <else>
                    <a class="num" href="[@htmlspecialchars($var.page_link)]" title="第[@htmlspecialchars($var.page_num)]页">[@htmlspecialchars($var.page_num)]</a>
                </if>
            </foreach>
            <if $page_info.page.next_url>
                <a class='text' href='[@htmlspecialchars($page_info.page.next_url)]'>下一页</a>
            </if>
        </div>
    </div>
</div>
<script>
    $(function(){
        $.checkboxEvent();
        
        $("#do_btn").click(function(e){
            $.doBatchAction();
            return false;
        });
        
        /*$("#filter_btn").click(function(e){
            var filter = $("#filter").val();
            if (filter == "0") {
                $.showPageInfo("#page_info", '请过滤条件', 500, true);
            }
            else {
                $.getFilter(filter);
            }
            return false;
        });*/
        $.edit();
        $.delObject('/admin/admin_modal/delmodals');
        $("[name=search_btn]").unbind('click').click(function(e){
            var $key = $("#search_txt").val();
            if ($key == "") {
                $.showPageInfo("#page_info", '请填写查询条件', 500, true);
                return false;
            }
            $url = "/admin/admin_modal/searchmodals?keywords=" + $key;
            $.search($url);
            return false;
        });
        $.initForIe6();
    })
</script>
